import React, { useCallback } from 'react'
import { Button, Image } from '@tarojs/components'
import Images from '@ASSET/Images'
import contactDialog from '@UTILS/contactDialog'
import { getPlatform } from '@UTILS/common'
import style from './ContactButton.module.scss'

const { isWeb } = getPlatform()

interface Props {
  btnContainer: string;
}

const ContactButton: React.FC<Props> = ({ btnContainer }) => {
  const onClickContact = useCallback(() => {
    isWeb && contactDialog()
  }, [])
  return (
    <Button openType="contact" onClick={onClickContact} className={`${style.contact_btnContainer} ${btnContainer}`}>
      <Image src={Images.managePlan.icon_contact_home} className={style.contact_btnIcon} />
    </Button>
  )
}

export default ContactButton
